import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { actionCreators } from '../../store';

import { message, Input, Button, Modal, Menu, Dropdown, InputNumber, Tabs } from 'antd';

import BasicInfo from './basicInfo';

const { TabPane } = Tabs;

class taskDetail extends Component{
  state={
    visible:false,
  };

  handleClick = () => {
    let visible = this.state.visible;
    this.setState({visible:!visible});
  }

  componentDidMount(){
    this.props.onRef(this);
  }

  render(){
    return (
      <Modal
      title="任务详情"
      visible={this.state.visible}
      bodyStyle={{ padding: '12px 24px 24px 24px',boxSizing:"border-box", maxHeight: 720, overflow: 'auto' }}
      width="800px"
      onOk={this.handleClick}
      onCancel={this.handleClick}>
        <Tabs defaultActiveKey="1" centered>
          <TabPane tab="基本属性" key="1">
            <BasicInfo/>
          </TabPane>
          <TabPane tab="采集配置" key="2">
            Content of Tab Pane 2
          </TabPane>
          <TabPane tab="数据存储/传输" key="3">
            Content of Tab Pane 3
          </TabPane>
          <TabPane tab="数据加工" key="4">
            Content of Tab Pane 3
          </TabPane>
        </Tabs>
      </Modal>
    );
  }
}

const mapStateToProps = (state) => {
  return {
    //tasks: state.getIn(['task','tasks']).toJS()
  }
}

const mapDispatchToProps = (dispatch) => ({
  
})

export default connect(mapStateToProps, mapDispatchToProps)(taskDetail);